<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    div {
        width: 300px;
        height: 300px;
        text-align: center;
        line-height: 300px;
        border-style: solid;
        border-width: 1px;
        font-size:30px;
        background-color: aqua;
    }
</style>

<body>
    <div>广告会在5秒后关闭~</div>
</body>
<script>
    const div = document.querySelector('div');
    setTimeout(()=>{
        div.style.display = 'none';
    },5000);
</script>
</html>